import type { ProgressInfo } from '../../api/file-transfer';

export interface FileUploadItem {
  id: string;
  name: string;
  size: number;
  file: File;
  status:
    | 'calculating-md5'
    | 'cancelled'
    | 'error'
    | 'pending'
    | 'success'
    | 'uploading';
  progress?: ProgressInfo;
  md5Progress?: {
    percentage: number;
    processedBytes: number;
    totalBytes: number;
  };
  error?: string;
  uploadedId?: string;
  shareCode?: string; // 上传成功后生成的分享码
  editToken?: string; // 分享编辑令牌
  backendId?: number; // 后端分享记录ID
}

export interface UploadOptions {
  chunkSize?: number;
  maxRetry?: number;
  message?: string; // 上传留言
}

export interface UploadStatistics {
  total: number;
  pending: number;
  uploading: number;
  success: number;
  error: number;
  cancelled: number;
}
